package com.lebang.model.enums.buss;

public enum  TableName {
    /**redis队列名称**/
    MultiWord("tb_multiword:", 0,"多词任务"),
    Speech("tb_multiword_speech:", 1,"Speech"),
    SpeechPlan("tb_multiword_speech_plan:", 2,"多词任务执行计划每日量"),
    WxOneQueue("WxOneQueue:",3,"微信一元提现key");

    private String title;
    private int index;
    private String msg;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    private TableName(String title, int index,String msg) {
        this.title = title;
        this.index = index;
        this.msg=msg;
    }

    public static TableName getByIndex(int index) {
        for (TableName e : TableName.values()) {
            if (e.index == index) {
                return e;
            }
        }
        return null;
    }

    public static TableName getByTitle(String title) {
        if (null == title) {
            return null;
        }
        for (TableName e : TableName.values()) {
            if (e.title.equals(title)) {
                return e;
            }
        }
        return null;
    }
}
